package cn.njxzc.demo.basm;

/**
 * Created by jiax on 3/30/2017.
 */
public abstract class Account {
    private long userid;  //userid,if user mysql,then this field auto gen
    private int password;//login password
    private String username;//User real name
    private String personid;//ID
    private String email;
    private int accountType; //0:Savings deposit card； 1:Credit
    protected double balance;// Account balance

    Account() {

    }

    Account(long userid, int password, String username, String personid, String email, int accountType) {
        super();
        this.userid = userid;
        this.password = password;
        this.username = username;
        this.personid = personid;
        this.email = email;
        this.accountType = accountType;
    }

    abstract void despite(int money);

    abstract int withdraw(int money);

    public long getUserid() {
        return userid;
    }

    public int getPassword() {
        return password;
    }

    public String getUsername() {
        return username;
    }

    public String getPersonid() {
        return personid;
    }

    public String getEmail() {
        return email;
    }

    public int getAccountType() {
        return accountType;
    }

    public double getBalance() {
        return balance;
    }

    public void setUserid(long userid) {
        this.userid = userid;
    }

    public void setPassword(int password) {
        this.password = password;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public void setPersonid(String personid) {
        this.personid = personid;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public void setAccountType(int accountType) {
        this.accountType = accountType;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }
}
